﻿Option Explicit On
Option Strict On

''' <summary>
''' Clase Servicio: Para almacenar los datos de un servicio de la BBDD
''' </summary>
''' <author>Héctor Pastor Pérez</author>

Public Class Servicio
    Private _cod As Integer
    Private _nombre As String
    Private _precio As Single
    Private _descripcion As String

    'Propiedades
    Public Property Cod As Integer
        Get
            Return _cod
        End Get
        Set(ByVal value As Integer)
            _cod = value
        End Set
    End Property

    Public Property Nombre As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property

    Public Property Precio As Single
        Get
            Return _precio
        End Get
        Set(ByVal value As Single)
            _precio = value
        End Set
    End Property

    Public Property Descripcion As String
        Get
            Return _descripcion
        End Get
        Set(ByVal value As String)
            _descripcion = value
        End Set
    End Property

    'Constructores
    Public Sub New()
        _cod = 0
        _nombre = ""
        _precio = 0
        _descripcion = ""
    End Sub

    Public Sub New(ByVal nuevoCodigo As Integer, ByVal nuevoNombre As String, ByVal nuevoPrecio As Single, ByVal nuevaDescripcion As String)
        _cod = nuevoCodigo
        _nombre = nuevoNombre
        _precio = nuevoPrecio
        _descripcion = nuevaDescripcion
    End Sub

    'Destructores
    Public Sub Dispose()
        _cod = 0
        _nombre = ""
        _precio = 0
        _descripcion = ""
    End Sub

    Protected Overrides Sub finalize()
        _cod = 0
        _nombre = ""
        _precio = 0
        _descripcion = ""
    End Sub
End Class
